class TazerAltFire extends WeaponFire;

function MeleeTargetting()
{
  local vector HitLoc, X, Y, Z;
  local actor Other;

  // Get vectors for where the player is aiming on each axis
  GetAxes(Instigator.GetViewRotation(), X, Y, Z);
  // Iterate through all actors within 100 UUs of the player
  foreach Instigator.VisibleActors(class'Actor', Other, 100.0, Owner.Location)
  {
    // Only deal with actor's within the ~45 degrees in front of the player
    if (normal(X) dot normal(Other.Location - Owner.Location) >= 0.7)
    {
      // Calculate the hit location
      HitLoc = Other.Location + (Other.Location - Owner.Location)
               * Other.CollisionRadius;

      //Level.GetLocalPlayerController().clientMessage("In damage area of bot");
      // Insert code to deal damage, spawn effects etc. here
      if (Other != None)
      {
        // Level.GetLocalPlayerController().clientMessage("You're about to get beat down by a bot");
         if (Pawn(Other) != none) {
           // Level.GetLocalPlayerController().clientMessage("You're getting beat down by a bot");
            Pawn(Other).TakeDamage(2, Instigator, Pawn(Other).Location, vect(0,0,0), class'XWeapons.DamTypeAssaultBullet');
         }
      }
    }
  }
}

event ModeDoFire()
{
   if (!AllowFire())
      return;

  MeleeTargetting();
}

defaultproperties
{
     PreFireAnim="PreFire"
     FireAnim="Fire"
     FireLoopAnim="FireLoop"
     FireEndAnim="FireEnd"
     ReloadAnim="Reload"
     FireAnimRate=0.750000
     FireSound=SoundGroup'WeaponSounds.PulseRifle.PulseRifleFire'
     FireForce="TranslocatorFire"
     FireRate=.1000
     AmmoClass=Class'XWeapons.LinkAmmo'
     AmmoPerFire=1
     ShakeRotMag=(X=40.000000)
     ShakeRotRate=(X=2000.000000)
     ShakeRotTime=2.000000
     ShakeOffsetMag=(Y=1.000000)
     ShakeOffsetRate=(Y=-2000.000000)
     ShakeOffsetTime=4.000000
     BotRefireRate=0.05000
     WarnTargetPct=0.100000
     FlashEmitterClass=Class'XEffects.LinkMuzFlashProj1st'
     bSplashDamage=false
}
